home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / svgakt50.zip / SRC / SVGAKIT / VESAVBE.H < prev   
C/C++ Source or Header  |  1994-08-23  |  4KB  |  90 lines

  1. /****************************************************************************
  2. *
  3. *                              The SuperVGA Kit
  4. *
  5. *                   Copyright (C) 1994 SciTech Software.
  6. *                           All rights reserved.
  7. *
  8. * Filename:     $RCSfile: vesavbe.h $
  9. * Version:      $Revision: 1.1 $
  10. *
  11. * Language:     ANSI C
  12. * Environment:  IBM PC (MSDOS) Real Mode and 16/32 bit Protected Mode.
  13. *
  14. * Description:  Header file declaring the structures used to comminucate
  15. *               with a VESA VBE compliant BIOS.
  16. *
  17. *               MUST be compiled in the large model.
  18. *
  19. * $Id: vesavbe.h 1.1 1994/08/22 12:27:00 kjb release $
  20. *
  21. ****************************************************************************/
  22.  
  23. #ifndef __VESAVBE_H
  24. #define __VESAVBE_H
  25.  
  26. #ifndef __DEBUG_H
  27. #include "debug.h"
  28. #endif
  29.  
  30. /*---------------------- Macros and type definitions ----------------------*/
  31.  
  32. /* Note that to avoid compiler alignment problems (presently DJGPP doesnt
  33.  * seem to support packing to a byte boundary) we declare the structures
  34.  * to simply be simple char array's, and provide a set of macros for
  35.  * extracting 16 and 32 bit values from the structures. Horrible but the
  36.  * only possible solution for the time being.
  37.  */
  38.  
  39. /* SuperVGA information block */
  40.  
  41. typedef struct {
  42.     char    VESASignature[4];       /* 'VESA' 4 byte signature          */
  43.     char    VESAVersion[2];         /* VBE version number               */
  44.     char    OEMStringPtr[4];        /* Far pointer to OEM string        */
  45.     char    Capabilities[4];        /* Capabilities of video card       */
  46.     char    VideoModePtr[4];        /* Far pointer to supported modes   */
  47.     char    TotalMemory[2];         /* Number of 64kb memory blocks     */
  48.     char    reserved[232];          /* Pad to 256 byte block size       */
  49.     } VgaInfoBlock;
  50.  
  51. /* SuperVGA mode information block */
  52.  
  53. typedef struct {
  54.     char    ModeAttributes[2];      /* Mode attributes                  */
  55.     char    WinAAttributes;         /* Window A attributes              */
  56.     char    WinBAttributes;         /* Window B attributes              */
  57.     char    WinGranularity[2];      /* Window granularity in k          */
  58.     char    WinSize[2];             /* Window size in k                 */
  59.     char    WinASegment[2];         /* Window A segment                 */
  60.     char    WinBSegment[2];         /* Window B segment                 */
  61.     char    WinFuncPtr[4];          /* Far pointer to window function   */
  62.     char    BytesPerScanLine[2];    /* Bytes per scanline               */
  63.     char    XResolution[2];         /* Horizontal resolution            */
  64.     char    YResolution[2];         /* Vertical resolution              */
  65.     char    XCharSize;              /* Character cell width             */
  66.     char    YCharSize;              /* Character cell height            */
  67.     char    NumberOfPlanes;         /* Number of memory planes          */
  68.     char    BitsPerPixel;           /* Bits per pixel                   */
  69.     char    NumberOfBanks;          /* Number of CGA style banks        */
  70.     char    MemoryModel;            /* Memory model type                */
  71.     char    BankSize;               /* Size of CGA style banks          */
  72.     char    NumberOfImagePages;     /* Number of images pages           */
  73.     char    res1;                   /* Reserved                         */
  74.     char    RedMaskSize;            /* Size of direct color red mask    */
  75.     char    RedFieldPosition;       /* Bit posn of lsb of red mask      */
  76.     char    GreenMaskSize;          /* Size of direct color green mask  */
  77.     char    GreenFieldPosition;     /* Bit posn of lsb of green mask    */
  78.     char    BlueMaskSize;           /* Size of direct color blue mask   */
  79.     char    BlueFieldPosition;      /* Bit posn of lsb of blue mask     */
  80.     char    RsvdMaskSize;           /* Size of direct color res mask    */
  81.     char    RsvdFieldPosition;      /* Bit posn of lsb of res mask      */
  82.     char    DirectColorModeInfo;    /* Direct color mode attributes     */
  83.     char    res2[216];              /* Pad to 256 byte block size       */
  84.     } ModeInfoBlock;
  85.  
  86. #define    getShort(a)    (*((short*)&(a)))
  87. #define    getLong(a)    (*((long*)&(a)))
  88.  
  89. #endif  /* __VESAVBE_H */
  90.